require(['jquery','template'],function($,template){
	var res={
		code:"SUCCESS",
		info:"成功请求",
		data:[
			{
				title:"瀚林锦城",
				img:"images/120x120(1).jpg",
				add:"西乡塘",
				adddetails:"兴宁-兴宁区政府&nbsp;普通住宅&nbsp;期房&nbsp;待售&nbsp;",
				jiage:"价格待定",
				span1:"塔楼",
				span2:"普通住宅",
				span3:"毛坯"
			},
			{
				title:"南宁恒大华府",
				img:"images/120x120(1).jpg",
				add:"兴宁",
				adddetails:"兴宁-兴宁区政府&nbsp;普通住宅&nbsp;期房&nbsp;待售&nbsp;",
				jiage:"价格待定",
				span1:"期房",
				span2:"普通住宅",
				span3:"待售"
			},
			{
				title:"美泉1612",
				img:"images/120x120(1).jpg",
				add:"青秀",
				adddetails:"青秀-凤岭北&nbsp;双卫&nbsp;精装修&nbsp;普通住宅&nbsp;",
				jiage:"14500元/平",
				span1:"1套可售",
				span2:"双卫",
				span3:"精装修"
			},
			{
				title:"中海国际社区",
				img:"images/120x120(1).jpg",
				add:"兴宁",
				adddetails:"青秀-凤岭北&nbsp;双卫&nbsp;精装修&nbsp;普通住宅&nbsp;",
				jiage:"6500元/平",
				span1:"440套可售",
				span2:"不限购",
				span3:"塔楼"
			},
			{
				title:"保利领秀前城",
				img:"images/120x120(1).jpg",
				add:"青秀",
				adddetails:"青秀-凤岭北&nbsp;双卫&nbsp;精装修&nbsp;普通住宅&nbsp;",
				jiage:"9000元/平",
				span1:"板塔结合",
				span2:"普通住宅",
				span3:"品牌地产"
			},

		]
	}
$('#xhcontent').html(template('tel',res))
var main=$('#main');
	var mainIn=$('#main-in');
	var loading=false;
	var textTip=$('#textTip');
	var p=1;
	main.scroll(function() {
		if($(this).scrollTop()+main.height()>=mainIn.height()-10&&!loading){
			loading=true;
			$.post('/api/dynamic/time',{p:p},function(data){
				if(data.code=="SUCCESS"){
					$('#contWrap').append(template('tel',data))
					loading=false;
					p++;
				}else if(data.code=="NO_DATA"){
					textTip.html(data.info);
					main.unbind('scroll');
				}
				
			},'json')
		}
	})
})